package com.cntcdt.api.db.model.base;

import java.io.Serializable;
import java.sql.ResultSet;
import java.util.Date;

/**
 * 这是cdt_device的数据传输对象基类,直接与表对应<br>
 */
public abstract class DeviceModelBase implements Serializable, Comparable<DeviceModelBase> {

	private static final long serialVersionUID = 1L;

	/**
	 * 属性:id<br>
	 */
	private Integer id;
	/**
	 * 属性:shopId<br>
	 */
	private Integer shopId;
	/**
	 * 属性:shopName<br>
	 */
	private String shopName;
	/**
	 * 属性:shopAddress<br>
	 */
	private String shopAddress;
	/**
	 * 属性:maxDeviceCnt<br>
	 */
	private Integer maxCDBCnt;
	/**
	 * 属性:currDeviceCnt<br>
	 */
	private Integer currCDBCnt;
	/**
	 * 属性:addTime<br>
	 */
	private Date addTime;
	/**
	 * 属性:1设备有效 －1代表设备无效 默认0无效<br>
	 * 含义:1设备有效 －1代表设备无效 默认0无效<br>
	 */
	private Integer status;
	/**
	 * 属性:updateTime<br>
	 */
	private Date updateTime;
	/**
	 * 属性:借出<br>
	 * 含义:借出<br>
	 */
	private Integer checkout;
	/**
	 * 属性:借入<br>
	 * 含义:借入<br>
	 */
	private Integer checkin;

	// 终端的id即终端的一个出厂序列码，由4位地区码+8位序列码
	private String terminal;

	private String clientTime;// 客户端握手时间

	private Integer saleLine1;
	private Integer saleLine2;
	private Integer saleLine3;
	private Integer saleLine4;

	private Integer vd;// 电压
	private Integer tmp;// 温度
	private Integer smk;// 0表示无烟雾 1表示有烟雾

	private Integer lineNum1;
	private Integer lineNum2;
	private Integer lineNum3;
	private Integer lineNum4;

	private Integer breakdownCnt;

	private Integer garbageCnt;// 回收仓内的数量

	private Integer sellLineType;// 1表示售线系统正常使用，2表示购线三次失败后导致暂时停止售线，3表示后台手动更改停止售线

	private Date stopSellLineTime;// 购线失败一定次数后，重新开放售线的时间

	private Integer isStopBorrowCDB;// 该设备是否停止租借充电宝

	private Integer deviceChargeId;

	private String deviceOpenTime;

	private String deviceCloseTime;

	private Integer consociationCompanyId;

	private Integer companyDivideId;

	private Integer addLinePresentation1;

	private Integer addLinePresentation2;

	private Integer addLinePresentation3;
	
	private Integer addCDBPresentation;

	private Integer isNeedAddLineDevice;

	private Integer isErrorDevice;

	private Integer isNeedAddCDBDevice;

	private Integer isNotInLineDevice;

	private Integer isSellLineFailDevice;

	private Integer isPreMoneyBuyLine;

	private Integer isEmploy;

	private Integer chongdianbaoPriorityCnt;
	
	private String versionHardware;
	
	private String versionSoft;
	
	private Integer isBrokenNet;
	
	private String romVersion;
	
	/**
	 * 0表示旧方式12桶苹果34桶android  1代表方式：1桶typec2桶android34桶苹果
	 */
	private Integer sellLineVersion;

	/**
	 * 默认构造方法,构造一个默认的DeviceModelBase对象
	 */
	public DeviceModelBase() {
	}

	/**
	 * 构造函数
	 * 
	 * @param rs
	 *            数据库查询结果集
	 */
	public DeviceModelBase(ResultSet rs) {
		try {
			this.id = rs.getInt("id");
			this.shopId = rs.getInt("shopId");
			this.shopName = rs.getString("shopName");
			this.shopAddress = rs.getString("shopAddress");
			this.maxCDBCnt = rs.getInt("maxCDBCnt");
			this.currCDBCnt = rs.getInt("currCDBCnt");
			this.addTime = rs.getDate("addTime");
			this.status = rs.getInt("status");
			this.updateTime = rs.getDate("updateTime");
			this.checkout = rs.getInt("checkout");
			this.checkin = rs.getInt("checkin");
			this.clientTime = rs.getString("clientTime");
			this.terminal = rs.getString("terminal");
			this.saleLine1 = rs.getInt("saleLine1");
			this.saleLine2 = rs.getInt("saleLine2");
			this.saleLine3 = rs.getInt("saleLine3");
			this.saleLine4 = rs.getInt("saleLine4");
			this.vd = rs.getInt("vd");
			this.tmp = rs.getInt("tmp");
			this.smk = rs.getInt("smk");
			this.lineNum1 = rs.getInt("lineNum1");
			this.lineNum2 = rs.getInt("lineNum2");
			this.lineNum3 = rs.getInt("lineNum3");
			this.lineNum4 = rs.getInt("lineNum4");
			this.breakdownCnt = rs.getInt("breakdownCnt");
			this.garbageCnt = rs.getInt("garbageCnt");
			this.sellLineType = rs.getInt("sellLineType");
			this.stopSellLineTime = rs.getDate("stopSellLineTime");
			this.isStopBorrowCDB = rs.getInt("isStopBorrowCDB");
			this.deviceChargeId = rs.getInt("deviceChargeId");
			this.deviceOpenTime = rs.getString("deviceOpenTime");
			this.deviceCloseTime = rs.getString("deviceCloseTime");
			this.companyDivideId = rs.getInt("companyDivideId");
			this.consociationCompanyId = rs.getInt("consociationCompanyId");
			this.addLinePresentation1 = rs.getInt("addLinePresentation1");
			this.addLinePresentation2 = rs.getInt("addLinePresentation2");
			this.addLinePresentation3 = rs.getInt("addLinePresentation3");
			this.addCDBPresentation = rs.getInt("addCDBPresentation");
			this.isPreMoneyBuyLine = rs.getInt("isPreMoneyBuyLine");
			this.isEmploy = rs.getInt("isEmploy");
			this.versionHardware = rs.getString("versionHardware");
			this.versionSoft = rs.getString("versionSoft");
			this.romVersion = rs.getString("romVersion");
			this.sellLineVersion = rs.getInt("sellLineVersion");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	
	
	public Integer getAddLinePresentation3() {
		return addLinePresentation3;
	}

	public void setAddLinePresentation3(Integer addLinePresentation3) {
		this.addLinePresentation3 = addLinePresentation3;
	}

	public Integer getSellLineVersion() {
		return sellLineVersion;
	}

	public void setSellLineVersion(Integer sellLineVersion) {
		this.sellLineVersion = sellLineVersion;
	}

	public String getRomVersion() {
		return romVersion;
	}

	public void setRomVersion(String romVersion) {
		this.romVersion = romVersion;
	}

	public Integer getIsBrokenNet() {
		return isBrokenNet;
	}

	public void setIsBrokenNet(Integer isBrokenNet) {
		this.isBrokenNet = isBrokenNet;
	}

	public String getVersionHardware() {
		return versionHardware;
	}

	public void setVersionHardware(String versionHardware) {
		this.versionHardware = versionHardware;
	}

	public String getVersionSoft() {
		return versionSoft;
	}

	public void setVersionSoft(String versionSoft) {
		this.versionSoft = versionSoft;
	}

	public Integer getChongdianbaoPriorityCnt() {
		return chongdianbaoPriorityCnt;
	}

	public void setChongdianbaoPriorityCnt(Integer chongdianbaoPriorityCnt) {
		this.chongdianbaoPriorityCnt = chongdianbaoPriorityCnt;
	}

	public Integer getIsEmploy() {
		return isEmploy;
	}

	public void setIsEmploy(Integer isEmploy) {
		this.isEmploy = isEmploy;
	}

	public Integer getIsPreMoneyBuyLine() {
		return isPreMoneyBuyLine;
	}

	public void setIsPreMoneyBuyLine(Integer isPreMoneyBuyLine) {
		this.isPreMoneyBuyLine = isPreMoneyBuyLine;
	}

	public Integer getIsNeedAddLineDevice() {
		return isNeedAddLineDevice;
	}

	public Integer getSellLineType() {
		return sellLineType;
	}

	public void setSellLineType(Integer sellLineType) {
		this.sellLineType = sellLineType;
	}

	public Integer getIsStopBorrowCDB() {
		return isStopBorrowCDB;
	}

	public void setIsStopBorrowCDB(Integer isStopBorrowCDB) {
		this.isStopBorrowCDB = isStopBorrowCDB;
	}

	public void setIsNeedAddLineDevice(Integer isNeedAddLineDevice) {
		this.isNeedAddLineDevice = isNeedAddLineDevice;
	}

	public Integer getIsErrorDevice() {
		return isErrorDevice;
	}

	public void setIsErrorDevice(Integer isErrorDevice) {
		this.isErrorDevice = isErrorDevice;
	}

	public Integer getIsNeedAddCDBDevice() {
		return isNeedAddCDBDevice;
	}

	public void setIsNeedAddCDBDevice(Integer isNeedAddCDBDevice) {
		this.isNeedAddCDBDevice = isNeedAddCDBDevice;
	}

	public Integer getIsNotInLineDevice() {
		return isNotInLineDevice;
	}

	public void setIsNotInLineDevice(Integer isNotInLineDevice) {
		this.isNotInLineDevice = isNotInLineDevice;
	}

	public Integer getIsSellLineFailDevice() {
		return isSellLineFailDevice;
	}

	public void setIsSellLineFailDevice(Integer isSellLineFailDevice) {
		this.isSellLineFailDevice = isSellLineFailDevice;
	}

	public Integer getAddLinePresentation1() {
		return addLinePresentation1;
	}

	public void setAddLinePresentation1(Integer addLinePresentation1) {
		this.addLinePresentation1 = addLinePresentation1;
	}

	public Integer getAddLinePresentation2() {
		return addLinePresentation2;
	}

	public void setAddLinePresentation2(Integer addLinePresentation2) {
		this.addLinePresentation2 = addLinePresentation2;
	}

	public Integer getAddCDBPresentation() {
		return addCDBPresentation;
	}

	public void setAddCDBPresentation(Integer addCDBPresentation) {
		this.addCDBPresentation = addCDBPresentation;
	}

	public Integer getConsociationCompanyId() {
		return consociationCompanyId;
	}

	public void setConsociationCompanyId(Integer consociationCompanyId) {
		this.consociationCompanyId = consociationCompanyId;
	}

	public Integer getCompanyDivideId() {
		return companyDivideId;
	}

	public void setCompanyDivideId(Integer companyDivideId) {
		this.companyDivideId = companyDivideId;
	}

	public String getDeviceOpenTime() {
		return deviceOpenTime;
	}

	public void setDeviceOpenTime(String deviceOpenTime) {
		this.deviceOpenTime = deviceOpenTime;
	}

	public String getDeviceCloseTime() {
		return deviceCloseTime;
	}

	public void setDeviceCloseTime(String deviceCloseTime) {
		this.deviceCloseTime = deviceCloseTime;
	}

	public Integer getDeviceChargeId() {
		return deviceChargeId;
	}

	public void setDeviceChargeId(Integer deviceChargeId) {
		this.deviceChargeId = deviceChargeId;
	}

	public Date getStopSellLineTime() {
		return stopSellLineTime;
	}

	public void setStopSellLineTime(Date stopSellLineTime) {
		this.stopSellLineTime = stopSellLineTime;
	}

	/**
	 * 设置属性id<br>
	 * 
	 * @param id
	 *            待设置的属性id的值
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * 获取属性id<br>
	 * 
	 * @return 属性id的值
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * 设置属性shopId<br>
	 * 
	 * @param shopId
	 *            待设置的属性shopId的值
	 */
	public void setShopId(Integer shopId) {
		this.shopId = shopId;
	}

	/**
	 * 获取属性shopId<br>
	 * 
	 * @return 属性shopId的值
	 */
	public Integer getShopId() {
		return shopId;
	}

	/**
	 * 设置属性shopName<br>
	 * 
	 * @param shopName
	 *            待设置的属性shopName的值
	 */
	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	/**
	 * 获取属性shopName<br>
	 * 
	 * @return 属性shopName的值
	 */
	public String getShopName() {
		return shopName;
	}

	/**
	 * 设置属性shopAddress<br>
	 * 
	 * @param shopAddress
	 *            待设置的属性shopAddress的值
	 */
	public void setShopAddress(String shopAddress) {
		this.shopAddress = shopAddress;
	}

	/**
	 * 获取属性shopAddress<br>
	 * 
	 * @return 属性shopAddress的值
	 */
	public String getShopAddress() {
		return shopAddress;
	}

	/**
	 * 设置属性addTime<br>
	 * 
	 * @param addTime
	 *            待设置的属性addTime的值
	 */
	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	/**
	 * 获取属性addTime<br>
	 * 
	 * @return 属性addTime的值
	 */
	public Date getAddTime() {
		return addTime;
	}

	/**
	 * 设置属性1设备有效 －1代表设备无效 默认0无效<br>
	 * 含义:1设备有效 －1代表设备无效 默认0无效<br>
	 * 
	 * @param status
	 *            待设置的属性1设备有效 －1代表设备无效 默认0无效的值
	 */
	public void setStatus(Integer status) {
		this.status = status;
	}

	/**
	 * 获取属性1设备有效 －1代表设备无效 默认0无效<br>
	 * 含义:1设备有效 －1代表设备无效 默认0无效<br>
	 * 
	 * @return 属性1设备有效 －1代表设备无效 默认0无效的值
	 */
	public Integer getStatus() {
		return status;
	}

	/**
	 * 设置属性updateTime<br>
	 * 
	 * @param updateTime
	 *            待设置的属性updateTime的值
	 */
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	/**
	 * 获取属性updateTime<br>
	 * 
	 * @return 属性updateTime的值
	 */
	public Date getUpdateTime() {
		return updateTime;
	}

	/**
	 * 设置属性借出<br>
	 * 含义:借出<br>
	 * 
	 * @param checkout
	 *            待设置的属性借出的值
	 */
	public void setCheckout(Integer checkout) {
		this.checkout = checkout;
	}

	/**
	 * 获取属性借出<br>
	 * 含义:借出<br>
	 * 
	 * @return 属性借出的值
	 */
	public Integer getCheckout() {
		return checkout;
	}

	/**
	 * 设置属性借入<br>
	 * 含义:借入<br>
	 * 
	 * @param checkin
	 *            待设置的属性借入的值
	 */
	public void setCheckin(Integer checkin) {
		this.checkin = checkin;
	}

	/**
	 * 获取属性借入<br>
	 * 含义:借入<br>
	 * 
	 * @return 属性借入的值
	 */
	public Integer getCheckin() {
		return checkin;
	}

	/**
	 * 比较两个对象在逻辑上是否相等
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof DeviceModelBase)) {
			return false;
		}

		final DeviceModelBase otherModel = (DeviceModelBase) other;
		if (getId() != null && !getId().equals(otherModel.getId())) {
			return false;
		}
		return true;
	}

	/**
	 * 根据主键生成HashCode
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		StringBuffer buffer = new StringBuffer();
		buffer.append('|').append(id);
		return buffer.toString().hashCode();
	}

	public String getClientTime() {
		return clientTime;
	}

	public void setClientTime(String clientTime) {
		this.clientTime = clientTime;
	}

	public String getTerminal() {
		return terminal;
	}

	public void setTerminal(String terminal) {
		this.terminal = terminal;
	}

	public Integer getSaleLine1() {
		return saleLine1;
	}

	public void setSaleLine1(int saleLine1) {
		this.saleLine1 = saleLine1;
	}

	public Integer getSaleLine2() {
		return saleLine2;
	}

	public void setSaleLine2(int saleLine2) {
		this.saleLine2 = saleLine2;
	}

	public Integer getSaleLine3() {
		return saleLine3;
	}

	public void setSaleLine3(int saleLine3) {
		this.saleLine3 = saleLine3;
	}

	public Integer getSaleLine4() {
		return saleLine4;
	}

	public void setSaleLine4(int saleLine4) {
		this.saleLine4 = saleLine4;
	}

	public Integer getVd() {
		return vd;
	}

	public void setVd(int vd) {
		this.vd = vd;
	}

	public Integer getTmp() {
		return tmp;
	}

	public void setTmp(int tmp) {
		this.tmp = tmp;
	}

	public Integer getSmk() {
		return smk;
	}

	public void setSmk(int smk) {
		this.smk = smk;
	}

	public Integer getLineNum1() {
		return lineNum1;
	}

	public void setLineNum1(int lineNum1) {
		this.lineNum1 = lineNum1;
	}

	public Integer getLineNum2() {
		return lineNum2;
	}

	public void setLineNum2(int lineNum2) {
		this.lineNum2 = lineNum2;
	}

	public Integer getLineNum3() {
		return lineNum3;
	}

	public void setLineNum3(int lineNum3) {
		this.lineNum3 = lineNum3;
	}

	public Integer getLineNum4() {
		return lineNum4;
	}

	public void setLineNum4(int lineNum4) {
		this.lineNum4 = lineNum4;
	}

	public Integer getMaxCDBCnt() {
		return maxCDBCnt;
	}

	public Integer getCurrCDBCnt() {
		return currCDBCnt;
	}

	public void setMaxCDBCnt(Integer maxCDBCnt) {
		this.maxCDBCnt = maxCDBCnt;
	}

	public void setCurrCDBCnt(Integer currCDBCnt) {
		this.currCDBCnt = currCDBCnt;
	}

	public Integer getBreakdownCnt() {
		return breakdownCnt;
	}

	public void setBreakdownCnt(int breakdownCnt) {
		this.breakdownCnt = breakdownCnt;
	}

	public Integer getGarbageCnt() {
		return garbageCnt;
	}

	public void setGarbageCnt(int garbageCnt) {
		this.garbageCnt = garbageCnt;
	}

	@Override
	public int compareTo(DeviceModelBase o) {
		// TODO Auto-generated method stub
		if (o.shopName.compareTo(this.shopName) > 0) {
			return 1;
		} else if (o.shopName.compareTo(this.shopName) < 0) {
			return -1;
		} else {
			return 0;
		}

	}

	@Override
	public String toString() {
		return "DeviceModelBase [id=" + id + ", shopId=" + shopId + ", shopName=" + shopName + ", shopAddress="
				+ shopAddress + ", maxCDBCnt=" + maxCDBCnt + ", currCDBCnt=" + currCDBCnt + ", addTime=" + addTime
				+ ", status=" + status + ", updateTime=" + updateTime + ", checkout=" + checkout + ", checkin="
				+ checkin + ", terminal=" + terminal + ", clientTime=" + clientTime + ", saleLine1=" + saleLine1
				+ ", saleLine2=" + saleLine2 + ", saleLine3=" + saleLine3 + ", saleLine4=" + saleLine4 + ", vd=" + vd
				+ ", tmp=" + tmp + ", smk=" + smk + ", lineNum1=" + lineNum1 + ", lineNum2=" + lineNum2 + ", lineNum3="
				+ lineNum3 + ", lineNum4=" + lineNum4 + ", breakdownCnt=" + breakdownCnt + ", garbageCnt=" + garbageCnt
				+ ", sellLineType=" + sellLineType + ", stopSellLineTime=" + stopSellLineTime + ", isStopBorrowCDB="
				+ isStopBorrowCDB + ", deviceChargeId=" + deviceChargeId + ", deviceOpenTime=" + deviceOpenTime
				+ ", deviceCloseTime=" + deviceCloseTime + ", consociationCompanyId=" + consociationCompanyId
				+ ", companyDivideId=" + companyDivideId + ", addLinePresentation1=" + addLinePresentation1
				+ ", addLinePresentation2=" + addLinePresentation2 + ", addCDBPresentation=" + addCDBPresentation
				+ ", isNeedAddLineDevice=" + isNeedAddLineDevice + ", isErrorDevice=" + isErrorDevice
				+ ", isNeedAddCDBDevice=" + isNeedAddCDBDevice + ", isNotInLineDevice=" + isNotInLineDevice
				+ ", isSellLineFailDevice=" + isSellLineFailDevice + ", isPreMoneyBuyLine=" + isPreMoneyBuyLine
				+ ", isEmploy=" + isEmploy + ", chongdianbaoPriorityCnt=" + chongdianbaoPriorityCnt
				+ ", versionHardware=" + versionHardware + ", versionSoft=" + versionSoft + "]";
	}
}
